import Vue from 'vue'
import App from './App'

// vuex
import store from './store'

// 引入全局uView
import uView from '@/uni_modules/uview-ui'

import mixin from './common/mixin'

import {yxStepPath,srStepPath,mcStepPath} from '@/common/config.js'
import {getYxInfo,setYxInfo,getSrInfo,setSrInfo,getMcInfo,setMcInfo} from '@/common/infoStore.js'

Vue.prototype.$store = store

Vue.prototype.$getYxInfo = getYxInfo
Vue.prototype.$setYxInfo = setYxInfo
Vue.prototype.$yxStepPath = yxStepPath

Vue.prototype.$getSrInfo = getSrInfo
Vue.prototype.$setSrInfo = setSrInfo
Vue.prototype.$srStepPath = srStepPath

Vue.prototype.$mcStepPath = mcStepPath
Vue.prototype.$getMcInfo = getMcInfo
Vue.prototype.$setMcInfo = setMcInfo

Vue.config.productionTip = false

App.mpType = 'app'
Vue.use(uView)
import config from '@/common/config'
// 调用setConfig方法，方法内部会进行对象属性深度合并，可以放心嵌套配置
// 需要在Vue.use(uView)之后执行
uni.$u.setConfig({
  // 修改$u.config对象的属性
  config: {
    // 修改默认单位为rpx，相当于执行 uni.$u.config.unit = 'rpx'
    unit: 'upx'
  },
  // 修改$u.props对象的属性
  props: {
    input: {
      fontSize: config.baseFont
    },
    button: {
      normal:{
        fontSize: config.baseFont
      }
    }
  }
})

// #ifdef MP
// 引入uView对小程序分享的mixin封装
const mpShare = require('@/uni_modules/uview-ui/libs/mixin/mpShare.js')
Vue.mixin(mpShare)
// #endif

Vue.mixin(mixin)

const app = new Vue({
  store,
  ...App
})

// 引入请求封装
require('./util/request/index')(app)

app.$mount()
